home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / Interfaces / QD3DDrawContext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-14  |  6.9 KB  |  245 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        QD3DDrawContext.h                                         **
  4.  **                                                                          **
  5.  **                                                                          **
  6.  **     Purpose:    Draw context class types and routines                        **
  7.  **                                                                          **
  8.  **                                                                          **
  9.  **                                                                          **
  10.  **     Copyright (C) 1993-1995 Apple Computer, Inc. All rights reserved.     **
  11.  **                                                                          **
  12.  **                                                                          **
  13.  *****************************************************************************/
  14. #ifndef QD3DDrawContext_h
  15. #define QD3DDrawContext_h
  16.  
  17. #ifndef QD3D_h
  18. #include <QD3D.h>
  19. #endif  /*  QD3D_h  */
  20.  
  21. #if PRAGMA_ONCE
  22.     #pragma once
  23. #endif
  24.  
  25. #if defined(__MWERKS__)
  26.     #pragma enumsalwaysint on
  27.     #pragma align_array_members off
  28.     #pragma options align=native
  29. #endif
  30.  
  31. #if defined(WINDOW_SYSTEM_MACINTOSH) && WINDOW_SYSTEM_MACINTOSH
  32. #include <Quickdraw.h>
  33. #include <FixMath.h>
  34. #include <GXTypes.h>
  35. #endif /* WINDOW_SYSTEM_MACINTOSH */
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif /*  __cplusplus  */
  40.  
  41.  
  42. /******************************************************************************
  43.  **                                                                             **
  44.  **                            DrawContext Data Structures                         **
  45.  **                                                                             **
  46.  *****************************************************************************/
  47.  
  48. typedef enum TQ3DrawContextClearImageMethod{
  49.     kQ3ClearMethodNone,
  50.     kQ3ClearMethodWithColor
  51. } TQ3DrawContextClearImageMethod;
  52.  
  53.  
  54. typedef struct TQ3DrawContextData {
  55.     TQ3DrawContextClearImageMethod    clearImageMethod;
  56.     TQ3ColorARGB                    clearImageColor;
  57.     TQ3Area                            pane;
  58.     TQ3Boolean                        paneState;
  59.     TQ3Bitmap                        mask;
  60.     TQ3Boolean                        maskState;
  61.     TQ3Boolean                        doubleBufferState;
  62. } TQ3DrawContextData;
  63.  
  64.  
  65. /******************************************************************************
  66.  **                                                                             **
  67.  **                                DrawContext Routines                         **
  68.  **                                                                             **
  69.  *****************************************************************************/
  70.  
  71. QD3D_EXPORT TQ3ObjectType Q3DrawContext_GetType(
  72.     TQ3DrawContextObject        drawContext);
  73.  
  74. QD3D_EXPORT TQ3Status Q3DrawContext_SetData(
  75.     TQ3DrawContextObject        context,
  76.     const TQ3DrawContextData    *contextData);
  77.  
  78. QD3D_EXPORT TQ3Status Q3DrawContext_GetData(
  79.     TQ3DrawContextObject        context,
  80.     TQ3DrawContextData            *contextData);
  81.     
  82. QD3D_EXPORT TQ3Status Q3DrawContext_SetClearImageColor(
  83.     TQ3DrawContextObject        context,
  84.     const TQ3ColorARGB             *color);
  85.  
  86. QD3D_EXPORT TQ3Status Q3DrawContext_GetClearImageColor(
  87.     TQ3DrawContextObject        context,
  88.     TQ3ColorARGB                 *color);
  89.  
  90. QD3D_EXPORT TQ3Status Q3DrawContext_SetPane(
  91.     TQ3DrawContextObject        context,
  92.     const TQ3Area                 *pane);
  93.  
  94. QD3D_EXPORT TQ3Status Q3DrawContext_GetPane(
  95.     TQ3DrawContextObject        context,
  96.     TQ3Area                         *pane);
  97.  
  98. QD3D_EXPORT TQ3Status Q3DrawContext_SetPaneState(
  99.     TQ3DrawContextObject        context,
  100.     TQ3Boolean                    state);
  101.  
  102. QD3D_EXPORT TQ3Status Q3DrawContext_GetPaneState(
  103.     TQ3DrawContextObject        context,
  104.     TQ3Boolean                    *state);
  105.         
  106. QD3D_EXPORT TQ3Status Q3DrawContext_SetClearImageMethod(
  107.     TQ3DrawContextObject            context,
  108.     TQ3DrawContextClearImageMethod     method);
  109.         
  110. QD3D_EXPORT TQ3Status Q3DrawContext_GetClearImageMethod(
  111.     TQ3DrawContextObject            context,
  112.     TQ3DrawContextClearImageMethod     *method);
  113.         
  114. QD3D_EXPORT TQ3Status Q3DrawContext_SetMask(
  115.     TQ3DrawContextObject        context,
  116.     const TQ3Bitmap                *mask);
  117.         
  118. QD3D_EXPORT TQ3Status Q3DrawContext_GetMask(
  119.     TQ3DrawContextObject        context,
  120.     TQ3Bitmap                    *mask);
  121.  
  122. QD3D_EXPORT TQ3Status Q3DrawContext_SetMaskState(
  123.     TQ3DrawContextObject        context,
  124.     TQ3Boolean                    state);
  125.  
  126. QD3D_EXPORT TQ3Status Q3DrawContext_GetMaskState(
  127.     TQ3DrawContextObject        context,
  128.     TQ3Boolean                    *state);
  129.  
  130. QD3D_EXPORT TQ3Status Q3DrawContext_SetDoubleBufferState(
  131.     TQ3DrawContextObject        context,
  132.     TQ3Boolean                     state);
  133.  
  134. QD3D_EXPORT TQ3Status Q3DrawContext_GetDoubleBufferState(
  135.     TQ3DrawContextObject        context,
  136.     TQ3Boolean                     *state);
  137.  
  138.  
  139. /******************************************************************************
  140.  **                                                                             **
  141.  **                            Pixmap Data Structure                             **
  142.  **                                                                             **
  143.  *****************************************************************************/
  144.  
  145. typedef struct TQ3PixmapDrawContextData {
  146.     TQ3DrawContextData        drawContextData;
  147.     TQ3Pixmap                pixmap;
  148. } TQ3PixmapDrawContextData;
  149.  
  150.  
  151. /******************************************************************************
  152.  **                                                                             **
  153.  **                        Pixmap DrawContext Routines                             **
  154.  **                                                                             **
  155.  *****************************************************************************/
  156.  
  157. QD3D_EXPORT TQ3DrawContextObject Q3PixmapDrawContext_New(
  158.     const TQ3PixmapDrawContextData    *contextData);
  159.  
  160. QD3D_EXPORT TQ3Status Q3PixmapDrawContext_SetPixmap(
  161.     TQ3DrawContextObject            drawContext,
  162.     const TQ3Pixmap                    *pixmap);
  163.  
  164. QD3D_EXPORT TQ3Status Q3PixmapDrawContext_GetPixmap(
  165.     TQ3DrawContextObject            drawContext,
  166.     TQ3Pixmap                        *pixmap);
  167.  
  168. #if defined(WINDOW_SYSTEM_MACINTOSH) && WINDOW_SYSTEM_MACINTOSH
  169.  
  170. /******************************************************************************
  171.  **                                                                             **
  172.  **                        Macintosh DrawContext Data Structures                 **
  173.  **                                                                             **
  174.  *****************************************************************************/
  175.  
  176. typedef enum TQ3MacDrawContext2DLibrary {
  177.     kQ3Mac2DLibraryNone,
  178.     kQ3Mac2DLibraryQuickDraw,
  179.     kQ3Mac2DLibraryQuickDrawGX
  180. } TQ3MacDrawContext2DLibrary;
  181.  
  182.  
  183. typedef struct TQ3MacDrawContextData {
  184.     TQ3DrawContextData            drawContextData;
  185.     CWindowPtr                    window;
  186.     TQ3MacDrawContext2DLibrary    library;
  187.     gxViewPort                    viewPort;
  188.     CGrafPtr                    grafPort;
  189. } TQ3MacDrawContextData;
  190.  
  191.  
  192. /******************************************************************************
  193.  **                                                                             **
  194.  **                        Macintosh DrawContext Routines                         **
  195.  **                                                                             **
  196.  *****************************************************************************/
  197.  
  198. QD3D_EXPORT TQ3DrawContextObject Q3MacDrawContext_New(
  199.     const TQ3MacDrawContextData    *drawContextData);
  200.     
  201. QD3D_EXPORT TQ3Status Q3MacDrawContext_SetWindow(
  202.     TQ3DrawContextObject        drawContext,
  203.     const CWindowPtr            window);
  204.  
  205. QD3D_EXPORT TQ3Status Q3MacDrawContext_GetWindow(
  206.     TQ3DrawContextObject        drawContext,
  207.     CWindowPtr                    *window);
  208.  
  209. QD3D_EXPORT TQ3Status Q3MacDrawContext_SetGXViewPort(
  210.     TQ3DrawContextObject        drawContext,
  211.     const gxViewPort            viewPort);
  212.  
  213. QD3D_EXPORT TQ3Status Q3MacDrawContext_GetGXViewPort(
  214.     TQ3DrawContextObject        drawContext,
  215.     gxViewPort                    *viewPort);
  216.  
  217. QD3D_EXPORT TQ3Status Q3MacDrawContext_SetGrafPort(
  218.     TQ3DrawContextObject        drawContext,
  219.     const CGrafPtr                grafPort);
  220.  
  221. QD3D_EXPORT TQ3Status Q3MacDrawContext_GetGrafPort(
  222.     TQ3DrawContextObject        drawContext,
  223.     CGrafPtr                    *grafPort);
  224.  
  225. QD3D_EXPORT TQ3Status Q3MacDrawContext_Set2DLibrary(
  226.     TQ3DrawContextObject        drawContext,
  227.     TQ3MacDrawContext2DLibrary    library);
  228.  
  229. QD3D_EXPORT TQ3Status Q3MacDrawContext_Get2DLibrary(
  230.     TQ3DrawContextObject        drawContext,
  231.     TQ3MacDrawContext2DLibrary    *library);
  232.  
  233. #endif /* WINDOW_SYSTEM_MACINTOSH */
  234.  
  235. #ifdef __cplusplus
  236. }
  237. #endif /*  __cplusplus  */
  238.  
  239. #if defined(__MWERKS__)
  240. #pragma options align=reset
  241. #pragma enumsalwaysint reset
  242. #endif
  243.  
  244. #endif  /*  QD3DDrawContext_h  */
  245.